<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">

        <div><?php include "../public_flow/flow_show_info.php";?></div>

        <div class="table-box tablenes">
            <div class="title">基本信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">关联单据</td><td id="mid_number" class="colorlan tv"></td><td class="tt">交易类型</td><td id="type_name" class="tv"></td></tr>
                <tr><td class="tt">交易单号</td><td id="jiaonum" class="tv"></td><td class="tt">交易金额(元)</td><td id="money" class="tv"></td></tr>
                <tr><td class="tt">款项科目</td><td id="budid_name" class="tv"></td><td class="tt">款项摘要</td><td id="zhai" class="tv"></td></tr>
                <tr><td class="tt">交易对象</td><td id="faer" class="tv"></td><td class="tt">交易方式</td><td id="daotype" class="tv"></td></tr>
                <tr id="typeBank" class="layui-hide"><td class="tt">账户账号</td><td id="banknum" class="tv"></td><td class="tt">开户行</td><td id="bankname" class="tv"></td></tr>
                <tr><td class="tt">交易日期</td><td id="dt" class="tv"></td><td class="tt">资金账户</td><td id="accid_name" class="colorlan tv"></td></tr>
                <tr><td class="tt">经办人</td><td id="baner" class="tv" colspan="3"></td></tr>
                <tr><td class="tt">备注</td><td id="explain" class="tv" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>


        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_account_shou_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;
                var account = res.data.account;
                var midinfo = res.data.midinfo;

                $("#accid_name").text(account.name+'('+account.accnum+')').click(function () {
                    openPage('../account/show.php?id='+account.id);
                });


                if(midinfo.mid_number){
                    $("#mid_number").text(midinfo.mid_number).click(function () {
                        openPage('../'+midinfo.mid_page+'/show.php?id='+midinfo.mid);
                    });
                }



                $("#jiaonum").text(data.jiaonum);
                $("#type_name").text(data.type_name);
                $("#budid_name").text(data.budid_name);
                $("#money").text(data.money);
                $("#zhai").text(data.zhai);
                $("#faer").text(data.faer);
                $("#daotype").text(data.daotype);
                $("#dt").text(data.dt);
                $("#baner").text(data.baner);
                $("#explain").text(data.explain);


                if(data.type != 1 && data.type != 2 && data.type != 8 && data.type != 9 && data.type != 11 && data.type != 14){
                    $("#typeBank").removeClass('layui-hide');
                    $("#bankname").text(data.bankname);
                    $("#banknum").text(data.banknum);

                    // $(".pageshowtitle").text('交易明细(支出)');
                }else{
                    // $(".pageshowtitle").text('交易明细(收入)');
                }
                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('account_list', param_id);
        showpage_dropopt();
    });



</script>
</body>
</html>




